var west = new Ext.tree.Panel({
	title : '主菜单',
	region: 'west',
	collapsible: true,
	width : 200,
	autoScroll : true,
	//singleExpand : true,
	rootVisible : true,
	animate : true,
	//root:{ text: '根', expanded: true },
	store:TreeStore,
	listeners: { itemclick: function(view,rec,el,index,e){
		//Ext.Msg.alert('msg',rec.get('text'));
		 if (rec.isLeaf()) {                    // 叶子节点点击不进入链接
		        var tab = center.queryById(rec.get('id'));
		        if (tab) {
		            if (e !== undefined) {
		                e.stopEvent();
		            }
		            center.setActiveTab(tab);
		        } else {
		            if (e !== undefined) {                     // 显示叶子节点菜单
		                e.stopEvent();
		            }
		            centersetActiveTab(rec);
		        }
		    }
		    else {
		        // 不是叶子节点不触发事件
		        e.stopEvent();
		        //rec.toggle();                      // 点击时展开
		    }
	}}
});

//树型的点击事件
function centersetActiveTab(node) {
	//Ext.Msg.alert('msg',node.id);
	var tt = node.get('text');
    var funActive = eval(tt.substring(tt.indexOf('>') + 1, tt.indexOf('</')));
    //var funcAction = null;
    var tab = center.add({
        id: node.get('id'),
        iconCls: node.get('iconCls'),       
        xtype: "panel",
        title: node.get('text'),
       // baseCls:'allBackImage',
        closable: true,
        maskDiabled: true,
        frame: true,
        autoScroll : true,
        items: funActive
    });
    center.setActiveTab(node.get('id'));
}